//
//  ViewController.m
//  PresentViewContorller
//
//  Created by Justsoso on 16/2/24.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"
#import "ViewControllerD.h"
#import "ViewControllerE.h"
#import "ViewControllerB.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"popB"])
    {
        ViewControllerB *vcB = segue.destinationViewController;
        
        vcB.num = [self.numTextField.text intValue] *10;
    }
}

- (IBAction)popCBtnPressed:(id)sender
{
    [self performSegueWithIdentifier:@"popC" sender:nil];
}
- (IBAction)popDBtnPressed:(id)sender
{
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    ViewControllerD *vcD = [sb instantiateViewControllerWithIdentifier:@"vcD"];
    
    [self presentViewController:vcD animated:YES completion:nil];
}
- (IBAction)popEBtnPressed:(id)sender
{
    ViewControllerE *vcE = [[ViewControllerE alloc] init];
    vcE.modalPresentationStyle = UIModalPresentationFullScreen;
    vcE.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentViewController:vcE animated:YES completion:nil];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}
@end
